import 'package:flutter/material.dart';
import 'package:whale/helper/utils/util.dart';

import 'index.dart';

class ImInputVoicePage extends StatelessWidget {
  ImInputVoicePage({Key? key}) : super(key: key);
  final controller = Get.put(ImInputVoiceController());
  final state = Get.find<ImInputVoiceController>().state;
  // 主视图
  Widget _buildView() {
    return GestureDetector(
      key: state.key,
      onLongPressStart: controller.onLongPressStart,
      onLongPressEnd: controller.onLongPressEnd,
      onTapCancel: controller.onTapCancel,
      onLongPressMoveUpdate: controller.onLongPressMoved,
      child: Container(
        alignment: Alignment.center,
        height: state.h,
        decoration: BoxDecoration(
          color: const Color(0xfff8f9fc),
          borderRadius: BorderRadius.circular(5),
        ),
        child: Text(
          '按住说话',
          style: TextStyle(
            color: const Color(0xff333333),
            fontSize: 15.sp,
          ),
        ),
      ),
    );
  }

  @override
  Widget build(BuildContext context) {
    return GetBuilder<ImInputVoiceController>(
      builder: (_) {
        return _buildView();
      },
    );
  }
}
